﻿<style>
    .table.table-condensed > tbody > tr > td{vertical-align: inherit;}
</style>
<div class="panel panel-default padding-empty">
    <div class="panel-body padding-empty">
        <ol class="breadcrumb margin-empty">
            <li class="breadcrumb-color"><i class="fa fa-home"></i>&nbsp;主页</li>
            <li><a href="#/examReport/planList" class="breadcrumb-link">考试结果管理</a></li>
            <li class="active">{{planName}}</li>
        </ol>
    </div>
</div>

<div class="panel panel-default">
    <!--<div class="panel-heading">
        <h3>
            <i class="fa fa-desktop"></i>
            {{planName}} - 考试结果管理

            &nbsp;
            <button class="btn btn-turquoise btn-xs" onclick="javascript:history.go(-1);" title="返回上一页" style="margin-bottom: 0;">
                <i class="fa fa-chevron-left"></i>
            </button>
        </h3>

        <div class="panel-options">
        </div>
    </div>-->

    <div class="panel-body">
        <!--下拉框搜素-->
        <form class="form-inline pull-left">
            <!--<div class="form-group">
                <label class="control-label">考试状态：</label>
                <select ng-model="curStatus" ng-options="" class="form-control selectMaxWidth"></select>
            </div>-->
            <div class="form-group">
                <label class="control-label">考试结果生成状态：</label>
                <select ng-model="curBuildStatus" ng-options="item.buildName for item in buildStatusList" class="form-control selectMaxWidth"></select>
            </div>
            <div class="form-group">
                <label class="control-label">考试结果上传状态：</label>
                <select ng-model="curUploadStatus" ng-options="item.uploadName for item in uploadStatusList" class="form-control selectMaxWidth"></select>
            </div>

            <button class="btn btn-turquoise" ng-click="query();" style="margin-bottom: 0;margin-left: 20px;">
                <i class="fa fa-search"></i>
                搜索
            </button>
        </form>

        <form class="form-inline pull-right">
            <!--<button class="btn btn-turquoise" ng-click="signInReport();" ng-disabled="loadingState">
                <i class="fa fa-file-text-o"></i>
                签到报告
            </button>
            <button class="btn btn-turquoise" ng-click="build();" ng-disabled="loadingState">
                <i class="fa fa-spinner fa-spin" ng-show="loadingState"></i>
                <i class="fa fa-briefcase" ng-hide="loadingState"></i>
                生成
            </button>
            <button class="btn btn-turquoise" ng-click="generated();">
                <i class="fa fa-history"></i>
                查看已生成
            </button>-->

            <button class="btn btn-turquoise" ng-click="uploadResult()" ng-disabled="loadingState">
                <i class="fa fa-download"></i>
                批量上传考试结果
            </button>
        </form>

        <br />
        <table class="table responsive table-bordered table-hover table-condensed">
            <thead>
                <tr class="active">
                    <th class="text-center">
                        <input type="checkbox" ng-click="checkAll();" title="全选" ng-disabled="loadingState" />
                    </th>
                    <th class="text-center">#</th>
                    <th>科目</th>
                    <!--<th>考试状态</th>-->
                    <th class="text-center">考生人数</th>
                    <th class="text-center">结果生成状态</th>
                    <th class="text-center">上传状态</th>
                    <th>生成结果时间</th>
                    <th>上传时间</th>
                    <th class="text-center">操作</th>
                </tr>
            </thead>
            <tbody>
                <tr ng-repeat="item in list.items" ng-click="check(item);" style="cursor: pointer;">
                    <td class="text-center" rowspan="{{list[$index].behavior.length}}">
                        <input type="checkbox" id="cbxSubject_{{item.examSubjectID}}_{{item.examineeID}}" value="{{item.examSubjectID}},{{item.examineeID}}" ng-click="check(item);" ng-disabled="{{item.accountType}}" />
                    </td>
                    <!--序号-->
                    <td class="text-center" rowspan="{{list[$index].behavior.length}}">
                        {{$index+1}}
                    </td>
                    <!--科目-->
                    <td rowspan="{{list[$index].behavior.length}}" title="{{item.subjectName}}">
                        {{item.subjectName | formatLongStr}}
                    </td>
                    <!--考试状态-->
                    <!--<td rowspan="{{list[$index].behavior.length}}"></td>-->
                    <!--考生人数-->
                    <td rowspan="{{list[$index].behavior.length}}" class="text-center">{{item.examinerCount}}</td>
                    <!--结果生成状态-->
                    <td rowspan="{{list[$index].behavior.length}}" ng-switch on="item.examResult" class="text-center">
                        <span ng-switch-default>已生成</span>
                        <span ng-switch-when="">未生成</span>
                    </td>
                    <!--上传状态-->
                    <td rowspan="{{list[$index].behavior.length}}" ng-switch on="item.upload" class="text-center">
                        <span ng-switch-default></span>
                        <span ng-switch-when="0">考试结果尚未生成</span>
                        <span ng-switch-when="2">打包完成,等待上传</span>
                        <span ng-switch-when="4">上传完成</span>
                    </td>
                    <!--生成结果时间-->
                    <td rowspan="{{list[$index].behavior.length}}">
                        <span>{{item.createTime}}</span>
                    </td>
                    <!--上传时间-->
                    <td rowspan="{{list[$index].behavior.length}}">
                        <span>{{item.uploadTime}}</span>
                    </td>
                    <!--操作-->
                    <td class="text-center">
                        <div class="btn-group">
                            <button type="button" class="btn btn-turquoise btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                操作
                                <span class="caret"></span>
                            </button>
                            <ul class="dropdown-menu">
                                <li ng-repeat="curOper in operList" ng-click="oper(this)" ng-disabled="loadingState"><a href="javascript:;">{{curOper.operName}}</a></li>
                            </ul>
                        </div>
                    </td>
                </tr>
            </tbody>
        </table>

        <div class="page-list" ng-hide="list.totalPage==1">
            <div style="text-align: right;">
                <nav>
                    <ul class="pagination" style="margin-bottom:0;">
                        <li>
                            <a ng-click="Previous()" role="button">
                                <span role="button">上一页</span>
                            </a>
                        </li>
                        <li>
                            <a ng-click="Next()" role="button">
                                <span role="button">下一页</span>
                            </a>
                        </li>
                        <li>
                            <a style="border: none;margin-left: 0px;background: #FFF!important;">
                                第<input type="text" ng-model="currentPage" ng-keyup="selectPage()" style="width:40px;margin-top:-2px;text-align:center;">页
                                共<strong>{{totalPage}}</strong>页
                            </a>
                        </li>
                    </ul>
                </nav>
            </div>
        </div>
    </div>
    <div role="tabpanel" class="tab-pane active" ng-if="list.length <= 0">
        <h3 class="text-center">
            <img src="//openexamcdn.open.com.cn/openexam/static/App/images/nodata.jpg" alt="" />
            <!--<small>对不起，没有相关数据！</small>-->
        </h3>
    </div>
</div>
